package com.bxd.baodan.item;

import com.google.gson.Gson;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import com.bxd.baodan.base.BaseItem;

/**
 * 消息
 * 
 * @author oldfeel
 * 
 *         Create on: 2014年7月7日
 */
@DatabaseTable
public class MessageItem extends BaseItem implements Cloneable {
	@DatabaseField(generatedId = true)
	private int id;
	@DatabaseField
	private int type;
	@DatabaseField
	private int qid;
	@DatabaseField
	private String title;
	@DatabaseField
	private int aid;
	@DatabaseField
	private String uid;
	@DatabaseField
	private String content;
//	private ConnectItem bussiness;
	private UserItem userInfo;
	@DatabaseField
	private String data;
	@DatabaseField
	private String userString;
	@DatabaseField(defaultValue = "false")
	private boolean isread;
	@DatabaseField
	private long time;
	@DatabaseField
	private int isAppend;
	@DatabaseField
	private String image;

	@DatabaseField
	private int a_id;



	//语音推送相关
	@DatabaseField
	private long voiceTime;
	@DatabaseField
	private String filePathString;
	@DatabaseField
	private String voiceFile;
	@DatabaseField
	private int contentType;
	@DatabaseField
	private long voiceId;
	@DatabaseField
	private String url;


	@DatabaseField
	private String bdId;



	
	/**
	 * @return the data
	 */
	public String getData() {
		return data;
	}

	/**
	 * @param data the data to set
	 */
	public void setData(String data) {
		this.data = data;
	}

	/**
	 * @return the type
	 */
	public int getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(int type) {
		this.type = type;
	}


	public MessageItem() {
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUid() {
		return uid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public boolean isIsread() {
		return isread;
	}

	public void setIsread(boolean isread) {
		this.isread = isread;
	}

	public int getQid() {
		return qid;
	}

	public void setQid(int qid) {
		this.qid = qid;
	}

	public int getAid() {
		return aid;
	}

	public void setAid(int aid) {
		this.aid = aid;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}


	public UserItem getUserInfo() {
		if (userInfo == null) {
			try {
				userInfo = new Gson().fromJson(getUserString(), UserItem.class);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return userInfo;
	}
	public void setUserInfo(UserItem userInfo) {
		this.userInfo = userInfo;
	}

	public String getUserString() {
		if (userString == null) {
			userString = new Gson().toJson(userInfo);
		}
		return userString;
	}

	public void setUserString(String userString) {
		this.userString = userString;
	}



	private long noReadCount;

	public long getNoReadCount() {
		return noReadCount;
	}

	public void setNoReadCount(long noReadCount) {
		this.noReadCount = noReadCount;
	}

	@Override
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

	public int getIsAppend() {
		return isAppend;
	}

	public void setIsAppend(int isAppend) {
		this.isAppend = isAppend;
	}


	public String getFilePathString() {
		return filePathString;
	}

	public void setFilePathString(String filePathString) {
		this.filePathString = filePathString;
	}

	public String getVoiceFile() {
		return voiceFile;
	}

	public void setVoiceFile(String voiceFile) {
		this.voiceFile = voiceFile;
	}

	public long getVoiceTime() {
		return voiceTime;
	}

	public void setVoiceTime(long voiceTime) {
		this.voiceTime = voiceTime;
	}

	public int getContentType() {
		return contentType;
	}

	public void setContentType(int contentType) {
		this.contentType = contentType;
	}

	public long getVoiceId() {
		return voiceId;
	}

	public void setVoiceId(long voiceId) {
		this.voiceId = voiceId;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getA_id() {
		return a_id;
	}

	public void setA_id(int a_id) {
		this.a_id = a_id;
	}

	public String getBdId() {
		return bdId;
	}

	public void setBdId(String bdId) {
		this.bdId = bdId;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public class UserItem extends BaseItem {
		public String getImLoginSign() {
			return imLoginSign;
		}

		public void setImLoginSign(String imLoginSign) {
			this.imLoginSign = imLoginSign;
		}






		public String score;
		public String isbind;
		public String workTime;
		public String serviceCount;
		public String answerCount;

		private  String imLoginSign;
		private String u_id;
		private String ue_realname;
		private String ue_avatar;
		private String ue_sex;
		private String ua_vip;// 砖石顾问
		private String ua_is_verify;// 是否认证
		private String pwd;
		private String ue_like_num;
		private String u_type;// 代理人或者普通
		private String u_nick;
		private String ue_kik;
		private String ue_prncode;
		private String ue_citycode;
		private String companyname;// 保险公司
		private String phone;
		private String distance;// 距离
		private String u_telphone;//代理人电话号码
		private String birthday;//出生日期
		private String qq;
		private String city;
		private int conch;
		private String title;
		private String adept_field;//“团体保险”, 擅长领域
		private String agent_level;//2, 代理人等级
		private String agent_mark;//[1, 2, 3] 代理人身份标识

		private long ua_answer_count;
		public int ua_title;
		public String ua_lastSignTime;
		public String ua_star;
		public int ue_onlineStatus;
		public String ue_cityName;

		public String getCity() {
			return city;
		}

		public void setCity(String city) {
			this.city = city;
		}

		/**
		 * @return the conch
		 */
		public int getConch() {
			return conch;
		}

		/**
		 * @param conch the conch to set
		 */
		public void setConch(int conch) {
			this.conch = conch;
		}

		/**
		 * @return the title
		 */
		public String getTitle() {
			return title;
		}

		/**
		 * @param title the title to set
		 */
		public void setTitle(String title) {
			this.title = title;
		}

		/**
		 * @return the qq
		 */
		public String getQq() {
			return qq;
		}

		/**
		 * @param qq the qq to set
		 */
		public void setQq(String qq) {
			this.qq = qq;
		}

		/**
		 * @return the birthday
		 */
		public String getBirthday() {
			return birthday;
		}

		/**
		 * @param birthday the birthday to set
		 */
		public void setBirthday(String birthday) {
			this.birthday = birthday;
		}

		public String getPhone() {
			return phone;
		}

		public void setPhone(String phone) {
			this.phone = phone;
		}

		public String getDistance() {
			return distance;
		}

		public void setDistance(String distance) {
			this.distance = distance;
		}

		public String getUe_prncode() {
			return ue_prncode;
		}

		public void setUe_prncode(String ue_prncode) {
			this.ue_prncode = ue_prncode;
		}

		public String getUe_citycode() {
			return ue_citycode;
		}

		public void setUe_citycode(String ue_citycode) {
			this.ue_citycode = ue_citycode;
		}

		public String getCompanyname() {
			return companyname;
		}

		public void setCompanyname(String companyname) {
			this.companyname = companyname;
		}

		public String getUe_kik() {
			return ue_kik;
		}

		public void setUe_kik(String ue_kik) {
			this.ue_kik = ue_kik;
		}

		public String getUe_like_num() {
			return ue_like_num;
		}

		public void setUe_like_num(String ue_like_num) {
			this.ue_like_num = ue_like_num;
		}

		public String getU_id() {
			return u_id;
		}

		public void setU_id(String u_id) {
			this.u_id = u_id;
		}

		public String getUe_realname() {
			return ue_realname;
		}

		public void setUe_realname(String ue_realname) {
			this.ue_realname = ue_realname;
		}

		public String getUe_avatar() {
			return ue_avatar;
		}

		public void setUe_avatar(String ue_avatar) {
			this.ue_avatar = ue_avatar;
		}

		public String getUe_sex() {
			return ue_sex;
		}

		public void setUe_sex(String ue_sex) {
			this.ue_sex = ue_sex;
		}

		public String getUa_vip() {
			return ua_vip;
		}

		public void setUa_vip(String ua_vip) {
			this.ua_vip = ua_vip;
		}

		public String getUa_is_verify() {
			return ua_is_verify;
		}

		public void setUa_is_verify(String ua_is_verify) {
			this.ua_is_verify = ua_is_verify;
		}

		public String getPwd() {
			return pwd;
		}

		public void setPwd(String pwd) {
			this.pwd = pwd;
		}

		public String getU_type() {
			return u_type;
		}

		public void setU_type(String u_type) {
			this.u_type = u_type;
		}

		public String getU_nick() {
			return u_nick;
		}

		public void setU_nick(String u_nick) {
			this.u_nick = u_nick;
		}

		public String getU_telphone() {
			return u_telphone;
		}

		public void setU_telphone(String u_telphone) {
			this.u_telphone = u_telphone;
		}

		@Override
		public String toString() {
			return "UserItem [u_id=" + u_id + ", ue_realname=" + ue_realname
					+ ", ue_avatar=" + ue_avatar + ", ue_sex=" + ue_sex
					+ ", ua_vip=" + ua_vip + ", ua_is_verify=" + ua_is_verify
					+ ", pwd=" + pwd + ", ue_like_num=" + ue_like_num + ", u_type="
					+ u_type + ", u_nick=" + u_nick + ", ue_kik=" + ue_kik
					+ ", ue_prncode=" + ue_prncode + ", ue_citycode=" + ue_citycode
					+ ", companyname=" + companyname + ", phone=" + phone
					+ ", distance=" + distance + ", u_telphone=" + u_telphone + "]";
		}

		public String getAdept_field() {
			return adept_field;
		}

		public void setAdept_field(String adept_field) {
			this.adept_field = adept_field;
		}

		public String getAgent_level() {
			return agent_level;
		}

		public void setAgent_level(String agent_level) {
			this.agent_level = agent_level;
		}

		public String getAgent_mark() {
			return agent_mark;
		}

		public void setAgent_mark(String agent_mark) {
			this.agent_mark = agent_mark;
		}

		public long getUa_answer_count() {
			return ua_answer_count;
		}

		public void setUa_answer_count(long ua_answer_count) {
			this.ua_answer_count = ua_answer_count;
		}



	}
}
